package com.example.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.example.entity.Admin;
import com.example.entity.RespBean;
import com.example.entity.Role;
import org.springframework.security.core.Authentication;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author liu
 * @since 2022-01-27
 */
public interface IAdminService extends IService<Admin> {
    /**
     * 登录之后返回token
     * @param username
     * @param password
     * @param code
     * @param request
     * @return
     */

    RespBean login(String username, String password, String code, HttpServletRequest request);

    /**
     * 根据用户名获取用户
     * @param username
     * @return
     */
    Admin getAdminByUserName(String username);


    RespBean updateAdminPassword(String oldPass, String newPass, Integer adminId);

    RespBean updateAdminUserFace(String url, Integer id, Authentication authentication);

    List<Role> getRoles(Integer adminId);
}
